load("@fbcode_macros//build_defs:cpp_unittest.bzl", "cpp_unittest")
load("//folly/io/async/test/certs:defs.bzl", "alias_pem")

oncall("fbcode_entropy_wardens_folly")

alias_pem(pems = [
    "tests-cert.pem",
    "ca-cert.pem",
])

cpp_unittest(
    name = "openssl_hash_test",
    srcs = ["OpenSSLHashTest.cpp"],
    deps = [
        "//folly/io:iobuf",
        "//folly/portability:gtest",
        "//folly/ssl:openssl_hash",
    ],
)

cpp_unittest(
    name = "openssl_cert_utils_test",
    srcs = ["OpenSSLCertUtilsTest.cpp"],
    resources = [
        ":ca-cert.pem",
        ":tests-cert.pem",
    ],
    supports_static_listing = False,
    deps = [
        "//folly:format",
        "//folly:range",
        "//folly:string",
        "//folly/container:enumerate",
        "//folly/portability:gmock",
        "//folly/portability:gtest",
        "//folly/portability:openssl",
        "//folly/portability:time",
        "//folly/ssl:openssl_cert_utils",
        "//folly/ssl:openssl_ptr_types",
        "//folly/testing:test_util",
    ],
)

cpp_unittest(
    name = "ssl_session_manager_test",
    srcs = ["SSLSessionManagerTest.cpp"],
    deps = [
        "//folly/portability:gtest",
        "//folly/portability:openssl",
        "//folly/ssl:openssl_ptr_types",
        "//folly/ssl:ssl_session_manager",
        "//folly/ssl/detail:openssl_session",
    ],
)

cpp_unittest(
    name = "openssl_key_utils_test",
    srcs = ["OpenSSLKeyUtilsTest.cpp"],
    deps = [
        "//folly/portability:gtest",
        "//folly/ssl:openssl_key_utils",
        "//folly/ssl:password_collector",
    ],
)
